/*  
cd /projects/hsieh_project/proj_201809/code_1_data/
qsas data_1_save_all.sas 8 &
*/

libname llbd "/projects/data_commons/lbd/";
libname hr "/projects/hsieh_project/proj_201809/data/";

%Let dir_out = /projects/hsieh_project/proj_201809/data/;


/*---------------------------------------------------------*/
/* Load Raw Data */
/*---------------------------------------------------------*/

%Global c_keep_year;
%Let c_keep_year=%quote( );

data lbd;
  set llbd.lbd_clean;
  &c_keep_year.
run;

%include "/projects/hsieh_project/proj_201809/code_1_data/data_0_read_raw.sas" /source2;

data hr.lbd_all;
  set lbd;
run;

data hr.lbd_sel;
  set lbd;
  if year in (1977,1982,1987,1992,1997,2002,2007,2013,2014,2016);
run;

proc export data=hr.lbd_sel outfile="&dir_out./lbd_sel.dta" replace;
run;

/* End of SAS file */
